package vip.finance.makemoney.apiSpider.eastmoney;

import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import vip.finance.makemoney.config.feign.FeignJsonConfiguration;

/**
 * 东方财富证券交易api
 *
 * @author yangbin
 * @since 2023-01-19
 */
@FeignClient(name = "eastMoneyTradeApi", url = "${feign.rpc.eastmoney_trade_api_url}", configuration = FeignJsonConfiguration.class)
public interface EastMoneyTradeApi {
    //登录
    @PostMapping(value = "/Login/Authentication", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
    Response authentication(@RequestBody ReqAuthentication body);

    //登录验证
    @PostMapping(value = "/Trade/Buy")
    String tradeBuy();

    //我的资产
    @PostMapping(value = "/Com/queryAssetAndPositionV1")
    Object get_assets();

    //我的持仓
    @PostMapping(value = "/Search/GetStockList")
    String get_stock_list();

    //提交委托
    @PostMapping(value = "/Trade/SubmitTradeV2")
    String submit();

    //撤单
    @PostMapping(value = "/Trade/RevokeOrders")
    String revoke();

    //当日委托
    @PostMapping(value = "/Search/GetOrdersData")
    String get_orders_data();

    //当日成交
    @PostMapping(value = "/Search/GetDealData")
    String get_deal_data();

    //登录验证码
    @PostMapping(value = "/Login/YZM?randNum=")
    String yzm();

    //登录验证
    @PostMapping(value = "/Trade/Buy")
    String authentication_check();

    //历史成交
    @PostMapping(value = "/Search/GetHisDealData")
    String get_his_deal_data();

    //历史委托
    @PostMapping(value = "/Search/GetHisOrdersData")
    String get_his_orders_data();

    //查询可申购新股列表
    @PostMapping(value = "/Trade/GetCanBuyNewStockListV3")
    String get_can_buy_new_stock_list_v3();

    //查询可申购新债列表
    @PostMapping(value = "/Trade/GetConvertibleBondListV2")
    String get_convertible_bond_list_v2();

    //批量申购
    @PostMapping(value = "/Trade/SubmitBatTradeV2")
    String submit_bat_trade_v2();

    //信用我的资产
    @PostMapping(value = "/MarginSearch/GetRzrqAssets")
    String cr_get_rzrq_asserts();

    //信用我的持仓
    @PostMapping(value = "/MarginSearch/QueryCollateral")
    String cr_query_collateral();

    //信用提交委托
    @PostMapping(value = "/MarginTrade/SubmitTradeV2")
    String cr_submit();

    //信用撤单
    @PostMapping(value = "/MarginTrade/RevokeOrders")
    String cr_revoke();

    //信用当日委托
    @PostMapping(value = "/MarginSearch/GetOrdersData")
    String cr_get_orders_data();

    //信用当日成交
    @PostMapping(value = "/MarginSearch/GetDealData")
    String cr_get_deal_data();

    //信用历史委托
    @PostMapping(value = "/MarginSearch/GetHisOrdersData")
    String cr_get_his_orders_data();

    //信用历史成交
    @PostMapping(value = "/MarginSearch/GetHisDealData")
    String cr_get_his_deal_data();

    //信用查询可申购新股列表
    @PostMapping(value = "/MarginTrade/GetCanBuyNewStockListV3")
    String cr_get_can_buy_new_stock_list_v3();

    //信用查询可申购新债列表
    @PostMapping(value = "/MarginTrade/GetConvertibleBondListV2")
    String cr_get_convertible_bond_list_v2();

    //信用批量申购
    @PostMapping(value = "/MarginTrade/SubmitBatTradeV2")
    String cr_submit_bat_trade_v2();

}
